/****************************************************************************
 * Copyright (C) 2009-2010 SciTouch LLC
 * 
 * This file is part of Indigo toolkit.
 * 
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 3 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 ***************************************************************************/

#include <string.h>

#include "molecule/molecule.h"
#include "base_cpp/tlscont.h"
#include "base_cpp/auto_ptr.h"


QueryAtom::QueryAtom (int type_)
{
   clear();
   type = type_;
}

void QueryAtom::clear ()
{
   memset(this, 0, sizeof(QueryAtom));
}

bool QueryAtom::listContains (int label) const
{
   int i;

   for (i = 0; i < list_size; i++)
      if (list[i] == label)
         return true;

   return false;
}

void QueryAtom::addToList (int label)
{
   if (list_size > (int)NELEM(list))
      throw Molecule::Error("atom list overflow");

   list[list_size++] = label;
}

QueryBond::QueryBond (int type_)
{
   memset(this, 0, sizeof(QueryBond));
   type = type_;
}

void QueryBond::clear ()
{
   memset(this, 0, sizeof(QueryBond));
}
